<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
<%--	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/lib/bootstrap/css/bootstrap.css" />--%>
<%--	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/stylesheets/theme.css" />--%>
<%--	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css" />--%>
<%--	<script src="${pageContext.request.contextPath}/static/lib/jquery-1.7.2.min.js" type="text/javascript"></script>--%>


	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/lib/bootstrap/css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/stylesheets/theme.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css" />
	<script src="${pageContext.request.contextPath}/static/lib/jquery-1.7.2.min.js" type="text/javascript"></script>

	<!-- Demo page code -->

	<style type="text/css">
		#line-chart {
			height: 300px;
			width: 800px;
			margin: 0px auto;
			margin-top: 1em;
		}

		.brand {
			font-family: georgia, serif;
		}

		.brand .first {
			color: #ccc;
			font-style: italic;
		}

		.brand .second {
			color: #fff;
			font-weight: bold;
		}
	</style>

	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	<script src="lib/html5.js"></script>
	<![endif]-->

</head>
<body>


<div id="menuDiv" class="sidebar-nav">

</div>

<script src="${pageContext.request.contextPath}/static/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
	var parent="";
	var child="";

	var menuArray=[
		{
			id:"book-menu",
			parent:"图书管理",
			icon:"icon-dashboard",
			childList:[
				{name:"查看图书信息",url:"${pageContext.request.contextPath}/book/selectBook.do"},
				{name:"添加图书信息",url:"${pageContext.request.contextPath}/book/addBookEdit.do"},
				{name:"回收站",url:"booktrash/list"}
			]
		},
		{
			id:"ad-menu",
			parent:"促销管理",
			icon:"icon-dashboard",
			childList:[
				{name:"首页轮播",url:"${pageContext.request.contextPath}/shuffling/selectshufflingpic.do"},
				{name:"公告板",url:"promotion/adnews"}
			]
		},
		{
			id:"type-menu",
			parent:"分类管理",
			icon:"icon-briefcase",
			childList:[
				{name:"分类列表管理",url:"type/manager"}
			]
		},
		{
			id:"order-menu",
			parent:"订单管理",
			icon:"icon-legal",
			childList:[
				{name:"订单列表",url:"${pageContext.request.contextPath}/order/selectorder.do"},
				{name:"发货单列表",url:"orders/sendlist"},
				{name:"退货单列表",url:"orders/returnslist"}
			]
		},
		{
			id:"account-menu",
			parent:"会员管理",
			icon:"icon-legal",
			childList:[
				{name:"查看会员信息",url:"${pageContext.request.contextPath}/userby/userpage.action"},
				{name:"添加会员",url:"${pageContext.request.contextPath}/userby/userpage2.action"}
			]
		},
		{
			id:"stat-menu",
			parent:"报表统计",
			icon:"icon-legal",
			childList:[
				{name:"客户统计",url:"statcustomer.jsp"},
				{name:"销售概况",url:"statsales.jsp"},
				{name:"图书销售排行",url:"statbooktop.jsp"}
			]
		},
		{
			id:"setting",
			parent:"系统设置",
			icon:"icon-legal",
			childList:[
				{name:"地区列表",url:"settingarea.jsp"},
				{name:"设置发件邮箱",url:"settingemail.jsp"},
				{name:"设置密保问题",url:"settingpwdsafe.jsp"}
			]
		},
		{
			id:"permission",
			parent:"权限管理",
			icon:"icon-legal",
			childList:[
				{name:"用户列表",url:"pmmsuser.jsp"},
				{name:"角色列表",url:"pmmsrole.jsp"},
				{name:"权限列表",url:"pmmspermission.jsp"}
			]
		}
	];


	function menuClick(currentParent,currentChild){
		parent=currentParent;
		child=currentChild;
		loadMenu();
	}

	function loadMenu(){
		var str="<a href='index' class='nav-header'><i class='icon-comment'></i>首页</a>";
		for(var i=0;i<menuArray.length;i++){
			var obj=menuArray[i];
			str+="<a href='#"+obj.id+"' class='nav-header' data-toggle='collapse'>";
			str+="<i class='"+obj.icon+"'></i>";
			str+=obj.parent;
			str+="</a>";
			str+="<ul id='"+obj.id+"' class='"+(parent==obj.parent?"nav nav-list collapse in":"nav nav-list collapse")+"'>";
			for(var j=0;j<obj.childList.length;j++){
				var childObj=obj.childList[j];
				str+="<li class='"+(child==childObj.name?"active":"")+"'><a onClick='menuClick(\'"+obj.parent+"\',\'"+childObj.name+"\')' href='"+childObj.url+"'>";
				str+=childObj.name;
				str+="</a></li>";
			}
			str+="</ul>";
		}

		$("#menuDiv").html(str);
	}

	$(function(){
		loadMenu();
	});


</script>


<script src="${pageContext.request.contextPath}/static/lib/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript">
	$("[rel=tooltip]").tooltip();
	$(function() {
		$('.demo-cancel-click').click(function() {
			return false;
		});
	});
</script>

</body>
</html>